package guet.imagan.progbuilder.impl;

import guet.imagan.progbuilder.DefaultCompiler;
import guet.imagan.progbuilder.Project;
import guet.imagan.progbuilder.annotation.CompileCommand;
import guet.imagan.util.ListUtil;

import java.util.List;

@CompileCommand(commpilerName = "Java编译器",
		sourceFileExtension = {"java"},
		targetFileExtension = "class",
		command = {"javac", "{srcFiles}", "-encoding", "utf-8", "-d", "{targetPath}"})
public class JavaCompiler extends DefaultCompiler {

	@Override
	public void populatePlaceHolder(List<String> cmd, Project project) {
		super.populatePlaceHolder(cmd, project);
		ListUtil.replaceFirst(cmd,"{targetPath}",
				project.getOutputDir().getAbsolutePath());
	}
}
